home *** CD-ROM | disk | FTP | other *** search
Wrap
/* v1.63 AddSpace Marko Seppänen marko.seppanen@wwnet.fi */ address IMAGEENGINEER Options results signal on error /* Setup a place for errors to go */ if arg()=0 then exit x=arg(1) parse var x pic bg value . MARK pic PRIMARY PROJECT_INFO pic WIDTH picwidth=result PROJECT_INFO pic HEIGHT picheight=result PROJECT_INFO pic ZOOM origzoomval=result if bg="" then do if exists("ie:prefs/veaddspace.cfg") == "1" then do call open("temp","ie:prefs/veaddspace.cfg","R") values=readln("temp") parse var values ok bg value . call close("temp") end else do bg=0 value=20 end 'FORM "Add Space" "Use|Cancel"', 'CYCLE,"Background color","White|Black|Guess",'bg'', 'INTEGER,"Space to add",1,1000,'value',SLIDER' values=result parse var values ok bg value . if ok = 0 then exit call open("temp","ie:prefs/veaddspace.cfg","W") res=writeln("temp",values) call close("temp") end if value=="" then do 'REQUEST "Value is missing!" "Sorry"' exit end select when bg == 0 | upper(bg)=="WHITE" then do BRIGHTNESS pic 255 bgcolor=result RESIZE bgcolor picwidth+(value*2) picheight+(value*2) TILE bgcolor2=result CLOSE bgcolor MARK bgcolor2 SECONDARY COMPOSITE value value MIN pic2=result end when bg == 1 | upper(bg)=="BLACK" then do BRIGHTNESS pic "-255" bgcolor=result RESIZE bgcolor picwidth+(value*2) picheight+(value*2) TILE bgcolor2=result CLOSE bgcolor MARK bgcolor2 SECONDARY COMPOSITE value value MAX pic2=result end when bg == 2 | upper(bg)=="GUESS" then do CROP pic picwidth-1 picheight-1 picwidth-1 picheight-1 bgpixel=result RESIZE bgpixel picwidth+(value*2) picheight+(value*2) TILE bgcolor2=result CLOSE bgpixel MARK bgcolor2 SECONDARY COMPOSITE value value MIX 100 pic2=result end otherwise exit end CLOSE bgcolor2 PROJECT_SET pic2 ZOOM origzoomval exit /*******************************************************************/ /* This is where control goes when an error code is returned by IE */ /* It puts up a message saying what happened and on which line */ /*******************************************************************/ error: if RC=5 then do /* Did the user just cancel us? */ IE_TO_FRONT LAST_ERROR 'REQUEST "'||RESULT||'"' exit end else do IE_TO_FRONT LAST_ERROR 'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!' exit end